Relativistic Programming in Haskell Using Types to Enforce a Critical Section Discipline
نویسندگان
چکیده
Relativistic programming (RP) is a concurrent programming model in which readers can safely access shared data concurrently with writers that are modifying it. RP has been used extensively in operating system kernels, most notably in Linux, and is widely credited with improving the performance and scalability of Linux on highly concurrent architectures. However, using RP primitives safely is tricky, and existing implementations of RP do not identify most unsafe uses statically. This work introduces Monadic RP, a GHC Haskell library for RP, and presents an example of its use. To our knowledge, Monadic RP is the first RP implementation in Haskell. It provides a novel mechanism to statically rule out a subset of unsafe relativistic programs by using types to separate readside and write-side critical sections, and to restrict the operations available in each. This work describes the current status of our implementation, presents a brief experimental evaluation of it, and discusses directions for ongoing and future work.
منابع مشابه
Using Haskell’s Type Systems to Check Relation Algebraic Programs
Relation algebra provides a theoretically well founded framework to state algorithms in a declarative and concise way. Among other properties the language of relations is based on a rigorous typing discipline. Current systems to compute with relations do not, however, provide the user with type inference to ease programming. In addition, the systems lack in other aspects, like the possibility t...
متن کامل“Based on the data in …” Cohesive markers in Results and Discussion Section of Research Articles
Cohesive frames are linguistic elements that precede the grammatical subject in the main clause. This study investigated the frequencies and communicative purposes of cohesive frame types in results and discussion section of research articles from 4 disciplines. To run this study, 40 results and discussion sections of research articles were selected from 4 disciplines, namely Applied Linguistic...
متن کاملMonads for Incremental Computing Functional Pearl
This paper presents a monadic approach to incremental computation, suitable for purely functional languages such as Haskell. A program that uses incremental computation is able to perform an incremental amount of computation to accommodate for changes in input data. Recently, Acar, Blelloch and Harper presented a small Standard ML library that supports efficient, high-level incremental computat...
متن کاملNon-Relativistic Limit of Neutron Beta-Decay Cross-Section in the Presence of Strong Magnetic Field
One of the most important reactions of the URCA that lead to the cooling of a neutron star, is neutron beta-decay ( ). In this research, the energy spectra and wave functions of massive fermions taking into account the Anomalous Magnetic Moment (AMM) in the presence of a strong changed magnetic field are calculated. For this purpose, the Dirac-Pauli equation for charged and neutral fermions is ...
متن کاملReducing the Cost of Precise Types
Programs involving precise types enforce more properties via type-checking, but precise types also prevent the reuse of functions throughout a program since no single precise type is used throughout a large program. My work is a step toward eliminating the underlying dilemma regarding type precision versus function reuse. It culminates in a novel traversal operator that recovers the reuse by au...
متن کامل